package com.xiangban.xiangbanmall.fegin.fallback;

import com.xiangban.xiangbanmall.fegin.PayFeign;
import com.xiangban.xiangbanmall.fegin.UserServiceFeign;
import com.xiangban.xiangbanmall.model.TUser;
import com.xiangban.xiangbanmall.model.res.ApiResult;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;

/**
 * @Author Mr. MaYaYun
 * @Data 2021/11/11 15:13
 */
@Component
@Slf4j
public class PayFallBack implements FallbackFactory<PayFeign> {


    public PayFeign create(Throwable throwable) {
        return new PayFeign() {


            @Override
            public ApiResult<Object> unifiedOrder(HashMap<String, String> map) {

                return ApiResult.newError("pay =>>> unifiedOrder 服务接口异常");
            }

            @Override
            public ApiResult<Object> transfers(HashMap<String, String> map) {

                return ApiResult.newError("pay =>>> transfers 服务接口异常");
            }
        };
    }
}
